Skip to content
This repository was archived by the owner on Jan 8, 2026. It is now read-only.

Add support for testValue definitions in nested props only#16

Closed
zchsh wants to merge 1 commit intomainfrom
zs.tweak-object-props-test-value
Closed

Add support for testValue definitions in nested props only#16
zchsh wants to merge 1 commit intomainfrom
zs.tweak-object-props-test-value

Conversation

@zchsh
Copy link
Copy Markdown
Contributor

@zchsh zchsh commented Mar 6, 2021

This PR removes the need to defined an empty base testValue: {} for object properties. An effect of this change is that object properties will now return an empty object as their testValue, even if it is not defined.

We may or may not want to make this change, just suggesting it as defining an empty object as a testValue at multiple levels in hashicorp/react-components#154 felt odd.

The approach taken here is:

  • If testValue on an object prop is not explicitly set, then we'll default it to {}. This way, we don't have to explicitly set the base empty object testValue: {} at every level of a complex object prop.
  • The current behaviour is still possible - it can be opted into by explicitly setting testValue: undefined on the "object" prop. This only needs to be done once, at the "top level" of the tree.

@zchsh zchsh force-pushed the zs.tweak-object-props-test-value branch from 0ca792d to 4c41c38 Compare March 6, 2021 02:31
@hashicorp-cla
Copy link
Copy Markdown

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@nandereck nandereck closed this Jan 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants